/*
 * Saphre - Suffix Arrays for Phrase Extraction
 * Copyright (C) 2013 
 * Dale Gerdemann - Tübingen, Germany 
 * Niko Schenk - Frankfurt am Main, Germany
 * All rights reserved.
 *
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 *
 */
package serialization;

import saphre.commands.CmdGappy;
import saphre.commands.CmdMaximals;

/**
 * This class loads binary (index) corpus data 
 * (serialized / .ser) files from disc
 * and executes a command.
 * 
 * @author Niko Schenk
 */
public class DeserializerDemo {
    
    private static final String PATH_TO_SER_DATA = "src/main/resources/corpusProjects/testcorpus/serialize";
    
    /**
     * 
     * @param args
     * @throws Exception 
     */
    public static void main(String[] args) throws Exception {
        SaphreWebRouter swr = new SaphreWebRouter();
        SaphreWebRouter.SaphreDeserializedObject sdo = swr.deserializeSaphreFromDisk(PATH_TO_SER_DATA);
        
        // Exectute gappy command.
        CmdGappy cmdG = new CmdGappy();
        cmdG.executeCommandGappy(sdo.store, sdo.pa, sdo.top, sdo.sa);
        
        // Execute maximal phrases command.
        CmdMaximals cmdM = new CmdMaximals();
        cmdM.extractMaximalPhrases(sdo.store, sdo.sa, sdo.pa, sdo.top);     
    }
}
